home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 201-225 / disk_219 / mv / readme < prev    next >
Text File  |  1992-05-06  |  6KB  |  166 lines

  1.                  mv/cp/rm v1.1 - move, copy, or remove
  2.                   files in the style of Unix mv/cp/rm
  3.  
  4.                    Copyright 1989 Edwin Hoogerbeets
  5.  
  6. This code is freely redistributable as long as no charge other than
  7. reasonable copying fees is levied for it.
  8.  
  9. Usage:
  10.  
  11.     mv [-cfix]    [-] file1 file2
  12.     mv [-cfix]    [-] path1 [path2 ...] dir
  13.     cp [-fimnx]   [-] file1 file2
  14.     cp [-fimnxrR] [-] path1 [path2 ...] dir
  15.     rm [-cdfimrR] [-] path  [path ...]
  16.  
  17.   Where path is either a file or a directory.
  18.  
  19. Options:
  20.  
  21.     -c act like cp instead (as in "mv -c" means do a cp instead of mv)
  22.  
  23.     -d remove directories only if they are empty (as in AmigaDOS Delete)
  24.  
  25.     -f force quiet mode, overwriting destination files if necessary.
  26.  
  27.     -i force interactive mode
  28.  
  29.     -m act like mv instead
  30.  
  31.     -n do not copy file dates, comments and protections (use "n"ew dates..)
  32.  
  33.     -R same as -r
  34.     -r recursively do directories as well (mv is always recursive)
  35.  
  36.     -x act like rm instead (I ran out of option letters, that's why...)
  37.  
  38.     -  end of options (useful to remove a file whose name starts with
  39.        a dash eg. "-d")
  40.  
  41.   Options f and i are mutually exclusive, with i taking precedence.
  42.  
  43. Notes:
  44.  
  45.   Yes, a three in one program! It slices, it dices, it even does
  46.   julienne fries!
  47.  
  48.   This version has the following features: [if I did not screw up :-]
  49.  
  50.     - file permissions, dates, and comments are also copied or moved
  51.       by default (switchable)
  52.     - supports arp wildcarding, but does not insist on it (see below)
  53.     - moves across volumes are supported
  54.     - directories can be moved or copied recursively, even across
  55.       volumes
  56.     - attempts to allocate a big enough buffer to be able to copy
  57.       or move files in one pass (reduces thrashing and increases speed)
  58.     - does not print the bloody "foobar...copied" message for each file
  59.       (which also increases speed)
  60.     - can detect when two files are on the same volume (even if an
  61.       assigned name is given) and uses Rename instead of copying
  62.     - honours the delete bit
  63.     - supports "" as current directory (eg. mv df1:* "")
  64.  
  65.   This version has the following misfeatures:
  66.  
  67.     - if a copy or move fails, it does not remove any files whatsoever
  68.       (maybe it is a feature, I do not know)
  69.     - all options are available to all forms of this program, though
  70.       some are not used by some forms. (hence the usage information
  71.       above) No checks are done for non-useful options.
  72.  
  73.  
  74.   that maybe Manx specific. (I don't have Lattice, so I don't really
  75.   know!)
  76.  
  77.   The action performed depends on the executable's name. There are entries
  78.   in the makefile to change the default name of the executables, if a
  79.   different name is desired. Copy one executable to a different name to
  80.   get a different action. The default action is to copy, since no files
  81.   are removed and this is the least destructive option.
  82.  
  83.   There is a small test script for the Dillon/Drew shell (easily ported to
  84.   other shells) to test almost everything I can think of. If you can get
  85.   cp/rm/mv to guru, or at least do something wierd, please send me a test
  86.   case for the script and I will fix it pronto!
  87.  
  88.   It is possible to get by with only one copy of the executable if you
  89.   use a shell that supports aliases. The following aliases might be
  90.   helpful:
  91.  
  92.     alias cp mv -c           - mv is the single executable name
  93.     alias rm mv -x           - x for remove. (makes sense, eh??)
  94.     alias delete mv -xd      - act like AmigaDOS Delete command
  95.     alias rmdir mv -xd       - remove directory a la unix
  96.     alias mv Mv              - use the external mv/cp/rm command instead
  97.     alias rm Rm                of the built in one!
  98.     alias cp Cp
  99.  
  100. Wildcards:
  101.  
  102.   Wildcards (arp) are supported at the request of Monsieur Dan Schein.
  103.   To access them, there are appropriate spots in the makefile to define
  104.   their use (using -DARP). The distribution binary was compiled with arp
  105.   wildcarding.
  106.  
  107.   If you do not have arp's programmers bindings, or if you do not wish to
  108.   have wildcards, I have put in numerous [ugly-looking] #ifdef's throughout
  109.   the code, so that it will compile without arp stuff as well. The
  110.   executables I use do not have the wildcarding because I use Matt's
  111.   (Drew Manxified) shell that expands the wildcards already.
  112.  
  113. Acknowledgements:
  114.  
  115.   If you thought your silly little example of Amiga programming is not
  116.   worth publicly releasing, think again. This whole program is made of
  117.   various hacked up examples, and has been very instructive for me to
  118.   write! Please give out any examples you think could be remotely useful,
  119.   as they probably are to someone. I hope that maybe this hack will be of
  120.   use to someone as an example (even though it is a mess).
  121.  
  122.   I would like to thank Matt Dillon (again) for his shell, from which
  123.   I hacked the remove routines and the date setting routines.
  124.   Thanks also to Chuck McManis for the GetVolume example from Fish 56.
  125.   Thanks to Doug Tittle for the initial inspiration for this program.
  126.   And finally, thanks to Rob Peck for his book, "Programmer's Guide to
  127.   the Amiga" from which most of the know-how in this program was
  128.   learned.
  129.  
  130. Files:
  131.  
  132.  ReadMe                    rwed    6392   13  27-Apr-89 22:01:43
  133.  cp                        rwed   13864   28  27-Apr-89 21:53:41
  134.  makefile                 arwed    1099    3  23-Apr-89 21:56:40
  135.  mv.c                     arwed   39338   78  24-Apr-89 00:30:35
  136.  mvtest.sh                arwed    5812   12  23-Apr-89 22:09:09
  137. 139 Blocks, 66505 Bytes used in 5 files
  138.  
  139. Revision History:
  140.  
  141. 1.1
  142.   - added in c, m and x options to allow one executable and different
  143.     actions using a shell's alias mechanism. (ie. alias cp mv -c)
  144.   - added d option to remove directories but only if they are empty
  145.     (as in the behaviour of AmigaDOS Delete)
  146.   - fixed problem with copying 0 byte files
  147.   - fixed problem with moving a file to itself with different
  148.     capitalization (mv foo Foo)
  149.   - detects much better if there is an attempt to copy a file to itself
  150.   - uses *much* less stack space (major problem with 1.0)
  151.   - somewhat smaller size (but now Manx dependant...)
  152.  
  153. 1.0
  154.   - initial effort
  155.  
  156. Please redirect any comments, criticisms or spare Swimsuit Issues
  157. of Sports Illustrated to:
  158.  
  159. Edwin Hoogerbeets
  160. Usenet: edwin@watcsc.waterloo.edu (May '89 to Aug '89)
  161. CIS:    72647,3675                (any time at all)
  162.  
  163.  
  164.  
  165.  
  166.